<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="application/javascript" src="jquery-3.2.1.js"></script>
</head>
<body>
<div id="box"></div>
<input type="button" value="提交" id="ipt">
<script type="application/javascript">
    var outData = {
            "customerName":"李浩",
            "customerCode":"",
            "customerPhone":"",
            "freight":"",
            "freightAddress":"深圳南山",
            "freightPhone":"",
            "otherInfo":""
        };
    $(function(){
        $('#ipt').click(function(){
            $.ajax({
                type: 'POST',
                contentType: "application/json; charset=utf-8",
                url: 'http://localhost:8096/test.php',
                data: JSON.stringify(outData),
                success: function(res){
                    console.log('返回数据为:',res);
                    $('#box').html(res)
                }
            })
        })
    })
</script>
</body>
</html>